import time

def bub(m):
    s = True
    while s:
        s = False
        for i in range(len(m) - 1):
            if int(m[i]) > int(m[i + 1]):
                m[i], m[i + 1] = m[i + 1], m[i]
                s = True
    return m


def times(m):
    t_n = time.time()
    n = bub(m)
    t_f = time.time()
    print('Время:', round((t_f - t_n)) * 1000, 'миллисекунд')


f1 = open('m3_shuffle.txt')
f2 = open('m2_reverse.txt')
f3 = open('m1_sorted.txt')
r1 = f1.readlines()
r2 = f2.readlines()
r3 = f3.readlines()
times(r1)
times(r2)
times(r3)
